package com.wonder.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wonder.admin.domain.Material;
import com.wonder.admin.domain.SysPrdIn;
import com.wonder.admin.mapper.MaterialDAO;
import com.wonder.admin.mapper.StoreTokenDao;
import com.wonder.admin.mapper.SysPrdInDao;
import com.wonder.admin.request.SysRoleRequest;
import com.wonder.admin.service.IMaterialService;
import com.wonder.admin.service.IVtuzxKingdeeService;
import com.wonder.admin.service.SysPrdInService;
import com.wonder.bean.kingdee.VtuzxKingdeeCloudClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

@Service
public class IMaterialServiceImpl extends ServiceImpl<MaterialDAO, Material> implements IMaterialService {
    @Autowired
    private MaterialDAO materialDAO;

    @Autowired
    private IVtuzxKingdeeService kingdeeService;

    @Autowired
    private StoreTokenDao storeTokenDao;

    @Override
    public IPage<Material> selectList(SysRoleRequest sysRoleRequest, Page<Material> page) {

        //查询条件
        QueryWrapper<Material> wrapper = new QueryWrapper<>();
        IPage<Material> materialIPage = materialDAO.selectPage(page,wrapper);
        return materialIPage;
    }

    @Override
    public void syncMaterial() throws Exception {
//        VtuzxKingdeeCloudClient client = kingdeeService.loginKingdee();
//        kingdeeService.query(client,"BD_MATERIAL",new ArrayList<>(
//
//        ),)
    }
}
